<!--
 * @Author: zi.yang
 * @Date: 2021-03-07 22:32:16
 * @LastEditors: zi.yang
 * @LastEditTime: 2021-03-07 22:57:35
 * @Description: In User Settings Edit
 * @FilePath: \My-JavaScript-Study\Vue Study\Vue原生\92、2021的重学01.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
    <style>
        .border{
            width: 300px;
            height: 100px;
            border: 1px solid blue;
            color: red;
            background: yellow;
        }
    </style>
</head>

<body>
    <div id="app">
        <div>{{ hello }}</div>
        <button @click="isTest=!isTest">点击{{isTest ? "隐藏" : "显示"}}</button>
        <div v-if="isTest ? true : false">哈哈哈，打字真辛苦</div>
        <input type="text" name="" id="" v-model="text">
        <div>{{ text }}</div>
        <div class="border">{{ content }}</div>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                hello: "Hello,World!",
                isTest:true,
                text:"",
                content:""
            },
            watch:{
                text(val){}
            }
        })

        vm.$watch("text", function(nov,ov){
            vm.content = ov
        } )
    </script>
</body>

</html>